package com.iotechn.unimall.app.api.article;

import com.dobbinsoft.fw.core.annotation.HttpMethod;
import com.dobbinsoft.fw.core.annotation.HttpOpenApi;
import com.dobbinsoft.fw.core.annotation.HttpParam;
import com.dobbinsoft.fw.core.annotation.HttpParamType;
import com.dobbinsoft.fw.core.annotation.param.NotNull;
import com.dobbinsoft.fw.core.annotation.param.Range;
import com.dobbinsoft.fw.core.exception.ServiceException;
import com.dobbinsoft.fw.support.model.Page;
import com.iotechn.unimall.data.vo.AppArticleDetailVO;
import com.iotechn.unimall.data.vo.ArticleVO;
import com.iotechn.unimall.data.vo.SelectVO;

import java.util.List;

@HttpOpenApi(group = "article", description = "文章服务")
public interface ArticleService {

    @HttpMethod(description = "文章page")
    public Page<ArticleVO> articlePage(
            @Range(min = 1) @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
            @Range(min = 1) @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "10") Integer limit,
            @NotNull @HttpParam(name = "articleClassId", type = HttpParamType.COMMON, description = "分类id") Long articleClassId
    ) throws ServiceException;

    @HttpMethod(description = "文章详情")
    public AppArticleDetailVO detail(
            @NotNull @HttpParam(name = "articleId", type = HttpParamType.COMMON, description = "文章id") Long articleId,
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "用户id") Long userId
    ) throws ServiceException;

    @HttpMethod(description = "文章类别")
    public List<SelectVO> articleType(
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "管理员ID") Long userId) throws ServiceException;


}
